package com.q3d.demo.svc.user.mybatis.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

import com.q3d.demo.svc.user.mybatis.model.UserBaseModel;
import com.q3d.demo.svc.user.mybatis.model.UserBaseModelExample;

public interface UserBaseModelMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @SelectProvider(type=UserBaseModelSqlProvider.class, method="countByExample")
    long countByExample(UserBaseModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @DeleteProvider(type=UserBaseModelSqlProvider.class, method="deleteByExample")
    int deleteByExample(UserBaseModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @Delete({
        "delete from t_user_base",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @Insert({
        "insert into t_user_base (uuid, active, ",
        "userid, nickname, ",
        "`password`, phonenumber, ",
        "email, avatar, create_time)",
        "values (#{uuid,jdbcType=CHAR}, #{active,jdbcType=SMALLINT}, ",
        "#{userid,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, ",
        "#{password,jdbcType=VARCHAR}, #{phonenumber,jdbcType=VARCHAR}, ",
        "#{email,jdbcType=VARCHAR}, #{avatar,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(UserBaseModel row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @InsertProvider(type=UserBaseModelSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(UserBaseModel row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @SelectProvider(type=UserBaseModelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="uuid", property="uuid", jdbcType=JdbcType.CHAR),
        @Result(column="active", property="active", jdbcType=JdbcType.SMALLINT),
        @Result(column="userid", property="userid", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="phonenumber", property="phonenumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<UserBaseModel> selectByExample(UserBaseModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "id, uuid, active, userid, nickname, `password`, phonenumber, email, avatar, ",
        "create_time",
        "from t_user_base",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="uuid", property="uuid", jdbcType=JdbcType.CHAR),
        @Result(column="active", property="active", jdbcType=JdbcType.SMALLINT),
        @Result(column="userid", property="userid", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="phonenumber", property="phonenumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    UserBaseModel selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @UpdateProvider(type=UserBaseModelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") UserBaseModel row, @Param("example") UserBaseModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @UpdateProvider(type=UserBaseModelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") UserBaseModel row, @Param("example") UserBaseModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @UpdateProvider(type=UserBaseModelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(UserBaseModel row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_user_base
     *
     * @mbg.generated
     */
    @Update({
        "update t_user_base",
        "set uuid = #{uuid,jdbcType=CHAR},",
          "active = #{active,jdbcType=SMALLINT},",
          "userid = #{userid,jdbcType=VARCHAR},",
          "nickname = #{nickname,jdbcType=VARCHAR},",
          "`password` = #{password,jdbcType=VARCHAR},",
          "phonenumber = #{phonenumber,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=VARCHAR},",
          "avatar = #{avatar,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(UserBaseModel row);
}